/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package elevenHomework;

/**
 *
 * @author Administrator
 */
import java.io.File;
import java.util.Comparator;
import java.util.Map;
import java.util.Scanner;  
import java.util.TreeMap;

public class ProblemE1 {
    public static void main(String[] args) throws Exception {
      //  Scanner in=new Scanner(System.in);
        Scanner in = new Scanner(new File("e:/acm/poj2418.txt"));
     //   TreeMap<String,Integer> tm=new TreeMap<String,Integer>(new StringComapator());
         TreeMap<String,Integer> tm=new TreeMap<String,Integer>();
        int sum=0;
        int a=0;
        while(in.hasNextLine()){
            String s=in.nextLine();
            if(!tm.containsKey(s)){
                tm.put(s, 1);
            }
            else{
                a=tm.get(s);
                tm.put(s, a+1);
            }
            sum++;
        }
    // Map<String,Integer> g2=  tm.descendingMap();
        //for(String ss:g2.KeySet()){
        
        for(String ss:tm.descendingKeySet()){
            float n=tm.get(ss)*100*1.0f/sum;
            System.out.printf("%s %.4f\n",ss,n);
        }
    }
}
